<?php

class DB_FOLLOWS_INCREMENT extends ORM_Table {
    
    static protected $table_name = 'follows_increment';
    
    static public function getTableName($params = null) {
        return self::$table_name;
    }
    
    /**
     * 添加记录
     * @param type $weibo_id
     * @param type $follow_id
     * @return DB_FOLLOWS_INCREMENT 
     */
    static function addRecord($weibo_id, $follow_id){
        $rs = ORM_Finder::findOne(DB_FOLLOWS_INCREMENT, array('weibo_id'=>$weibo_id, 'follow_id'=>$follow_id));
        if(!$rs){
            $rs = new DB_FOLLOWS_INCREMENT();
            $rs->setWeiboId($weibo_id);
            $rs->setFollowId($follow_id);
            $rs->save();
        }
        return $rs;
    }
}

?>
